package com.kaiqingsun.io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

public class Demo4 {
    public static void main(String[] args) throws Exception {
        InputStream is = new FileInputStream("./hello.txt");
        while (true){
            int data = is.read();
            if (data == -1){
                //所有数据被读完了
                break;
            }

            //否则data就是我们取到的数据
            byte b = (byte)data;
            System.out.printf("02x\n",b);
        }
     is.close();
    }
}
